	<?php 
		$type = $this->input->post('type') ;
		$key = $this->input->post('key') ;
		$category_id_post = $this->input->post('category_id') ;
		$match_id_post = $this->input->post('match_id') ;
		 
	?>
	
	<?php 
		$wickets = $this->feed->getWickets($type,$key,$match_id_post); 
		$currentInfo = $this->feed->getCurrentMatchInfo($type,$key,$match_id_post);
		if($currentInfo){
			$localteam_name = $currentInfo['localteam_name'];
			$visitorteam_name = $currentInfo['visitorteam_name'];
		}
		
		$wkNum = array();
		foreach($wickets as $k =>$val){
			$wkNum[] = $val['attributes']['inningnum'];
		}
		
		$latest = $wkNum[0];
	?>
	<?php if($wickets): ?>
	<?php foreach($wickets as $key => $val):?>	
		<?php if($latest == $val['attributes']['inningnum']):?>
			Inning Name: <?php echo $val['attributes']['name'];?>	<br />
			Team: <?php if($val['attributes']['team'] == 'visitorteam'){echo $visitorteam_name;}else{echo $localteam_name;} ?> <br />
			<b>Wickets:</b>
			<table>
				<thead>
					<th>post</th>
					<th>point</th>
					<th>name</th>
					<th>score</th>
					<th>id</th>
				</thead>
				<tbody>
				<?php foreach($val['wicket'] as $item):?>
					<tr>
						<td><?php echo $item['post'];?></td>
						<td><?php echo $item['point'];?></td>
						<td><?php echo $item['name'];?></td>
						<td><?php echo $item['score'];?></td>
						<td><?php echo $item['id'];?></td>
					</tr>
				<?php endforeach; ?>	
				</tbody>
			<table>	
			 <hr/>
		<?php endif;?>
		
	<?php endforeach;?>
	<?php endif;?>
 

